package LavEtRegneark;

public class SumCell extends Cell{
	private double value;
	
	public SumCell(Cell c1, Cell c2){
		value = (double)c1.getNumberValue() + (double)c2.getNumberValue();
	}
	
	// This Constructor is used to calculate the sum from an array of cells
	public SumCell(Cell[] cells){
		for(Cell c: cells){
			this.value = value + c.getNumberValue();
		}
	}

	@Override
	public double getNumberValue() {
		return value;
	}
	
	public String toString(){
		return "" + value;
	}

	
}
